[4/5] xen/xenbus: Count pending messages for each watch
authorSeongJae Park <sjpark@amazon.de>
Mon, 14 Dec 2020 09:07:13 +0000 (10:07 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 17 Dec 2020 05:31:52 +0000 (05:31 +0000)
commit429dbc0c152e1718aeef6c8cf609d75a556e9830
treeedb60323cb901ffa683d0ecf645a3ad44d09977c
parentdfd24d29928d697bd1738e23d7a74e7d04ac0a78
[4/5] xen/xenbus: Count pending messages for each watch

Origin: https://git.kernel.org/linus/3dc86ca6b4c8cfcba9da7996189d1b5a358a94fc
Bug: https://xenbits.xen.org/xsa/advisory-349.html
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2020-29568

This commit adds a counter of pending messages for each watch in the
struct.  It is used to skip unnecessary pending messages lookup in
'unregister_xenbus_watch()'.  It could also be used in 'will_handle'
callback.

This is part of XSA-349

Cc: stable@vger.kernel.org
Signed-off-by: SeongJae Park <sjpark@amazon.de>
Reported-by: Michael Kurth <mku@amazon.de>
Reported-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name xen-xenbus-Count-pending-messages-for-each-watch.patch
drivers/xen/xenbus/xenbus_xs.c
include/xen/xenbus.h